/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1632528496705_4418';
  //5.正确使用编写鉴权中间件（10分）
  config.passportGithub = {
    key: 'your_clientID',
    secret: 'your_clientSecret',
    // callbackURL: '/passport/github/callback',
    // proxy: false,
  }
  // add your middleware config here
  config.middleware = ["jwt", 'errorHandler'];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    security: {
      csrf: false
    },
    mysql: {
      // 单数据库信息配置
      client: {
        // host
        host: 'localhost',
        // 端口号
        port: '3306',
        // 用户名
        user: 'root',
        // 密码
        password: 'root',
        // 数据库名
        database: 'zhoukao',
      },
      // 是否加载到 app 上，默认开启
      app: true,
      // 是否加载到 agent 上，默认关闭
      agent: false,
    },
    oss: {
      client: {
        accessKeyId: 'LTAI5tFG7YQ9sPb2DjX1fNsf',
        accessKeySecret: 'BwdotPr1f8MWo9sDqnjMcN6NUiB3UJ',
        bucket: 'sun1233-oss',
        endpoint: 'oss-cn-beijing.aliyuncs.com',
        timeout: '60s',
      },
    },
    multipart: {
      mode: "file"
    },
    gitee: {
      client_id: "205af3272ca669ce6c87feb138ee61d9f94f8dbd96d45b239cea0e2d7a8ab574",
      client_secret: "2fda4b20f9cc5b770cd14627b6b547b6a69e42bee4e889e902e50c4cc7806f84",
      redirect_uri: "http://localhost:3000/login",
    }
  };

  return {
    ...config,
    ...userConfig,
  };
};
